import { request } from '../utils/request'

// 获取订单列表
export const orderList = (data) => {
  return request({
    url: '/Alipay/Order/orderList',
    method: 'POST',
    data
  })
}

// 个人中心获取订单数量
export const getOrderCount = () => {
  return request({
    url: '/Alipay/Order/getOrderCount',
    method: 'GET'
  })
}

// 个人中心商品推荐列表
export const indexList = (data) => {
  return request({
    url: '/Alipay/Centre/indexList',
    method: 'GET',
    data
  })
}

// 获取订单详情
export const orderInfo = (id) => {
  return request({
    url: '/Alipay/Order/orderInfo',
    method: 'GET',
    data: { order_id: id }
  })
}

// 账单详情
export const getOrderLease = (id) => {
  return request({
    url: '/Alipay/Order/getOrderLease',
    method: 'GET',
    data: { order_id: id }
  })
}

// 未支付取消订单
export const orderCancel = (id) => {
  return request({
    url: '/Alipay/Order/orderCancel',
    method: 'POST',
    data: { order_id: id }
  })
}

// 已支付待发货订单申请退款
export const applyOrderRefund = (data) => {
  return request({
    url: '/Alipay/Order/applyOrderRefund',
    method: 'POST',
    data
  })
}

// 撤销退款申请
export const cancelOrderRefund = (id) => {
  return request({
    url: '/Alipay/Order/cancelOrderRefund',
    method: 'POST',
    data: { order_id: id }
  })
}

// 确认收货
export const orderConfirmReceiving = (id) => {
  return request({
    url: '/Alipay/Order/orderConfirmReceiving',
    method: 'POST',
    data: { order_id: id }
  })
}

// 查看物流
export const checkOrderExpress = (id) => {
  return request({
    url: '/Alipay/Order/checkOrderExpress',
    method: 'GET',
    data: { order_id: id }
  })
}

// 获取申请退款页面信息
export const getOrderRefundData = (id) => {
  return request({
    url: '/Alipay/Order/getOrderRefundData',
    method: 'GET',
    data: { order_id: id }
  })
}

// 主动支付
export const prepaymentPay = (data) => {
  return request({
    url: '/Alipay/Pay/prepaymentPay',
    method: 'POST',
    data
  })
}

// 获取买断详情
export const getOrderBuyoutData = (id) => {
  return request({
    url: '/Alipay/Order/getOrderBuyoutData',
    method: 'GET',
    data: { order_id: id }
  })
}

// 买断支付
export const orderBuyoutPay = (order_id) => {
  return request({
    url: '/Alipay/Order/orderBuyoutPay',
    method: 'POST',
    data: { order_id }
  })
}

// 获取快递
export const getReturnExpressList = () => {
  return request({
    url: '/Alipay/Order/getReturnExpressList',
    method: 'GET'
  })
}

// 获取订单归还地址
export const getOrderReturnAddress = (order_id) => {
  return request({
    url: '/Alipay/Order/getOrderReturnAddress',
    method: 'GET',
    data: { order_id }
  })
}

// 订单归还添加快递信息
export const orderReturnAddExpress = (data) => {
  return request({
    url: '/Alipay/Order/orderReturnAddExpress',
    method: 'POST',
    data
  })
}

// 申请提前归还
export const orderApplyReturn = (order_id) => {
  return request({
    url: '/Alipay/Order/orderApplyReturn',
    method: 'POST',
    data: { order_id }
  })
}

// 撤销提前归还申请
export const orderReturnCancel = (order_id) => {
  return request({
    url: '/Alipay/Order/orderReturnCancel',
    method: 'POST',
    data: { order_id }
  })
}

// 归还物流
export const getReturnExpressData = (order_id) => {
  return request({
    url: '/Alipay/Order/getReturnExpressData',
    method: 'GET',
    data: { order_id }
  })
}

// 重新签约
export const orderPreAuth = (order_id) => {
  return request({
    url: '/Alipay/Order/orderPreAuth',
    method: 'GET',
    data: { order_id }
  })
}

// 获取续租商品状态
export const getRenewalGoodsStatus = (order_id) => {
  return request({
    url: '/Alipay/Order/getRenewalGoodsStatus',
    method: 'GET',
    data: { order_id }
  })
}

// 支付押金
export const orderBuyDeposit = (order_id) => {
  return request({
    url: '/Alipay/Order/orderBuyDeposit',
    method: 'POST',
    data: { order_id }
  })
}
//合同
export const ordedownload=(order_id)=>{
  return request({
    url: '/Alipay/Order/downloadContract',
    method: 'POST',
    data: { order_id }
  })
}